<?php
	$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
	$connection = socket_connect($socket, 'localhost', 8888) or die("服务链接失败\n");
	$data = $_GET['msg']; 
	$length = strlen($data);
	if(!socket_sendto($socket, $data, $length, 0, '127.0.0.1', 8888)){
		echo '消息发送失败';
	}else{
		echo '消息发送成功';
	}

?>